// src/viewpage/types.ts
export interface UserProfile {
  id: number;
  username: string;
  nickname: string;
  avatar?: string;
  followCount?: number;
  followerCount?: number;
  recipeCount?: number;
}

export interface Recipe {
  id: number;
  title: string;
  image: string;
  description?: string;
  duration?: number;
  difficulty?: number;
  servings?: number;
  likesCount?: number;
  favoriteCount?: number;
  userId?: number;
  createdAt?: string;
  updatedAt?: string;
}

export interface FollowInfo {
  followCount: number;
  followerCount: number;
  isFollowing: boolean;
}

export interface UserInfoProps {
  userProfile: UserProfile;
  followInfo: FollowInfo;
  isCurrentUser: boolean;
  onFollow: () => void;
  onFollowCountClick: () => void;
  onFollowerCountClick: () => void;
  onBack: () => void;
  onSearchClick: () => void;
}

export interface RecipeListProps {
  recipes: Recipe[];
  currentTab: '食谱' | '收藏';
  onRecipeClick: (recipe: Recipe) => void;
  onTabChange: (tab: '食谱' | '收藏') => void;
}

// 更新搜索相关类型
export interface SearchOption {
  key: string;
  label: string;
  type: 'input' | 'select';
  placeholder?: string;
  options?: { value: string; label: string }[];
}

export interface SearchParams {
  method: 'keyword' | 'time' | 'cuisine' | 'ingredient';
  value: string;
}